﻿
#region Using Directives.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Windows.Media.Imaging;

#endregion

namespace GDFlacTool.Common
{
    [Serializable]
    public class TrackCollection : List<Track>
    {
        #region Properties.

        public bool AllTracksHasFileImage
        {
            get { return CheckFileImage(); }
        }

        #endregion

        #region Private Methods.

        private bool CheckFileImage()
        {
            bool hasImage = true;

            foreach (Track track in this)
            {
                if (!track.HasFileCoverArt)
                    hasImage = false;
            }

            return hasImage;
        }

        #endregion

        #region Public Methods.

        public List<string> GetAllPaths()
        {
            return this.Select(track => track.FullPath).ToList();
        }

        public List<Track> GetTracks()
        {
            return this;
        }

        public void AddTrack(IList<Track> tracks)
        {
            AddRange(tracks);
        }

        #endregion
    }
}
